<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lesson Project: C:/Users/ttl/Documents/Lesson/Lesson_Project/T4056_Eternal_Watch/03_Firmware/Temp/User/Driver/LED/Src/led_driver.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Lesson Project<span id="projectnumber">&#160;Beta V1.1</span>
   </div>
   <div id="projectbrief">Course Learning Template Engineering</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6d4e12d46ad8519ff7b80e874016d102.html">User</a></li><li class="navelem"><a class="el" href="dir_81f18e0c07fff3e9102b10505e4dbf14.html">Driver</a></li><li class="navelem"><a class="el" href="dir_360e7d3b387520a2bbb10bb361dd28fa.html">LED</a></li><li class="navelem"><a class="el" href="dir_f0c161ddbdaa8fd0f7deec5e7eb00609.html">Src</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">led_driver.c</div></div>
</div><!--header-->
<div class="contents">
<a href="led__driver_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="led__driver_8h.html">led_driver.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type);</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type,GPIO_PinState state);</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type,GPIO_PinState * state);</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="led__driver_8c.html#aa935fef6ae8a8d5346c5ffe4033525aa">   17</a></span><span class="keyword">static</span> <a class="code hl_struct" href="structpin__driver__ops.html">pin_driver_ops_t</a> <a class="code hl_struct" href="structpin__driver__ops.html">pin_driver_ops</a> = {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    .<a class="code hl_variable" href="structpin__driver__ops.html#a021f2151c91ddf2521286bf6e58250db">pf_init</a> = <a class="code hl_function" href="led__driver_8c.html#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a>,</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>    .pf_set_state = <a class="code hl_function" href="led__driver_8c.html#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a>,</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    .pf_get_state = <a class="code hl_function" href="led__driver_8c.html#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a>,</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    .pf_toggle = <a class="code hl_function" href="led__driver_8c.html#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a>,</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>};</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="led__driver_8c.html#a16f0e758f9505cf4241ac3531058ba90">   30</a></span><span class="keyword">static</span> GPIO_TypeDef * <a class="code hl_function" href="led__driver_8c.html#a16f0e758f9505cf4241ac3531058ba90">get_port_from_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>{</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>    <span class="keyword">static</span> GPIO_TypeDef * port_table[] = {GPIOA,GPIOB,GPIOC,GPIOD,GPIOE};</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>    <span class="keywordflow">return</span> (GPIO_TypeDef *)port_table[name[0] - <span class="charliteral">&#39;A&#39;</span>];</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>}</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="led__driver_8c.html#acf867e62801ae7394802e18b3b428913">   42</a></span><span class="keyword">static</span> uint16_t <a class="code hl_function" href="led__driver_8c.html#acf867e62801ae7394802e18b3b428913">get_pin_from_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>{</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    <span class="keywordtype">char</span> * str_pin = (<span class="keywordtype">char</span> *)&amp;name[5];</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    uint16_t pin_num = strtol(str_pin,NULL,10);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keywordflow">return</span> (uint16_t)(1 &lt;&lt; pin_num);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>}</div>
</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="led__driver_8c.html#a593c0d522193f5d68afec676e7bbfa0c">   55</a></span><span class="keyword">static</span> uint32_t <a class="code hl_function" href="led__driver_8c.html#a593c0d522193f5d68afec676e7bbfa0c">get_mode_from_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>{</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    uint32_t mode = 0;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    <span class="keywordflow">if</span>(name[2] == <span class="charliteral">&#39;O&#39;</span> &amp;&amp; name[3] == <span class="charliteral">&#39;P&#39;</span>)</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        mode = GPIO_MODE_OUTPUT_PP;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(name[2] == <span class="charliteral">&#39;O&#39;</span> &amp;&amp; name[3] == <span class="charliteral">&#39;D&#39;</span>)</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        mode = GPIO_MODE_OUTPUT_OD;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(name[2] == <span class="charliteral">&#39;I&#39;</span>)</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>        mode = GPIO_MODE_INPUT;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    <span class="keywordflow">return</span> mode;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>}</div>
</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span> </div>
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="led__driver_8c.html#a1d910d69e5a02ecdd66993b6c939d9ed">   73</a></span><span class="keyword">static</span> uint32_t <a class="code hl_function" href="led__driver_8c.html#a1d910d69e5a02ecdd66993b6c939d9ed">get_pull_from_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>{</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>    uint32_t pull = GPIO_NOPULL;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    <span class="keywordflow">if</span>(name[2] == <span class="charliteral">&#39;I&#39;</span> &amp;&amp; name[3] == <span class="charliteral">&#39;U&#39;</span>)</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>        pull = GPIO_PULLUP;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(name[2] == <span class="charliteral">&#39;I&#39;</span> &amp;&amp; name[3] == <span class="charliteral">&#39;D&#39;</span>)</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>        pull = GPIO_PULLDOWN;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <span class="keywordflow">return</span> pull;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>}</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="foldopen" id="foldopen00091" data-start="{" data-end="}">
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="led__driver_8c.html#a03a4e480218ba93667c8be3b533976da">   91</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="led__driver_8c.html#a03a4e480218ba93667c8be3b533976da">gpio_clock_ebale</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>{</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    GPIO_TypeDef * gpio = <a class="code hl_function" href="led__driver_8c.html#a16f0e758f9505cf4241ac3531058ba90">get_port_from_name</a>(name);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>    </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    <span class="keywordflow">if</span>(GPIOA == gpio)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>        __HAL_RCC_GPIOA_CLK_ENABLE();</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(GPIOB == gpio)</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>        __HAL_RCC_GPIOB_CLK_ENABLE();</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(GPIOC == gpio)</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>        __HAL_RCC_GPIOC_CLK_ENABLE();</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(GPIOD == gpio)</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>        __HAL_RCC_GPIOD_CLK_ENABLE();</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(GPIOE == gpio)</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>        __HAL_RCC_GPIOE_CLK_ENABLE();</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>}</div>
</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="foldopen" id="foldopen00111" data-start="{" data-end="}">
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="led__driver_8h.html#a29f61f4f947d72aa4cec57fbccb4d2b4">  111</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#a29f61f4f947d72aa4cec57fbccb4d2b4">pin_driver_register</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type,<span class="keyword">const</span> <span class="keywordtype">char</span> * pin_name)</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>{</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>    <span class="keywordflow">if</span>(strlen(pin_name) != 7)</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>        <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>    </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a> = (<span class="keywordtype">char</span> *)pin_name;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a> = <a class="code hl_function" href="led__driver_8c.html#a16f0e758f9505cf4241ac3531058ba90">get_port_from_name</a>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a>);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a> = <a class="code hl_function" href="led__driver_8c.html#acf867e62801ae7394802e18b3b428913">get_pin_from_name</a>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a>);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> = <a class="code hl_function" href="led__driver_8c.html#a593c0d522193f5d68afec676e7bbfa0c">get_mode_from_name</a>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a>);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#af881021b980ca1b2632d0b302a58eba7">pull</a> = <a class="code hl_function" href="led__driver_8c.html#a1d910d69e5a02ecdd66993b6c939d9ed">get_pull_from_name</a>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a>);</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>    </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#a24f9910d53df9c5211690b1800116874">ops</a> = &amp;<a class="code hl_variable" href="led__driver_8c.html#aa935fef6ae8a8d5346c5ffe4033525aa">pin_driver_ops</a>;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#a24f9910d53df9c5211690b1800116874">ops</a>-&gt;<a class="code hl_variable" href="structpin__driver__ops.html#a021f2151c91ddf2521286bf6e58250db">pf_init</a>(me,pin_type);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>    me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#a24f9910d53df9c5211690b1800116874">ops</a>-&gt;<a class="code hl_variable" href="structpin__driver__ops.html#a1d30bddbe51efba10017364033c8c0f2">pf_set_state</a>(me,pin_type,GPIO_PIN_SET);</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>    </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>}</div>
</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span> </div>
<div class="foldopen" id="foldopen00137" data-start="{" data-end="}">
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="led__driver_8c.html#a5bb0271d4ae5eb2f4ad5abd83f0387c7">  137</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type)</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>{</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    GPIO_InitTypeDef GPIO_InitStruct = {0};</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>    <span class="keywordflow">if</span>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a49f666045d24aa8becc5244bc2396aca">init</a> == 0)</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>        <a class="code hl_function" href="led__driver_8c.html#a03a4e480218ba93667c8be3b533976da">gpio_clock_ebale</a>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">name</a>);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        GPIO_InitStruct.Mode = me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a>;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>        GPIO_InitStruct.Pull = me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#af881021b980ca1b2632d0b302a58eba7">pull</a>;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>        GPIO_InitStruct.Pin = me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a>;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>        GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>        HAL_GPIO_Init(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a>,&amp;GPIO_InitStruct);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>        HAL_GPIO_WritePin(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a>,GPIO_PIN_RESET);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>        <span class="keywordflow">if</span>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_PP || me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_OD)</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>            me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a> = GPIO_PIN_RESET;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>        me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a49f666045d24aa8becc5244bc2396aca">init</a> = 1;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>    }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>}</div>
</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span> </div>
<div class="foldopen" id="foldopen00166" data-start="{" data-end="}">
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"><a class="line" href="led__driver_8c.html#ad22a944898a0a1d9d4320579b5a096d8">  166</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type,GPIO_PinState state)</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>{</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>    <span class="keywordflow">if</span>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_OD || me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_PP)</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>    {</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>        <span class="keywordflow">if</span>(state != me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a>)</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>        {</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>            me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a> = state;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>            HAL_GPIO_WritePin(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a>);</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        }</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>    }</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>    <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>}</div>
</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span> </div>
<div class="foldopen" id="foldopen00190" data-start="{" data-end="}">
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"><a class="line" href="led__driver_8c.html#ac1fe82f7ae56795c7e934eb5fe8bc238">  190</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type,GPIO_PinState * state)</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>{</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>    <span class="keywordflow">if</span>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_INPUT)</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>    {</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>        me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a> = HAL_GPIO_ReadPin(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a>);</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>        * state = me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a>;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>    }</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>    <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>}</div>
</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span> </div>
<div class="foldopen" id="foldopen00209" data-start="{" data-end="}">
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="led__driver_8c.html#aee9852ab0453d24837b6eb3cdb74172c">  209</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="led__driver_8c.html#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a>(<a class="code hl_struct" href="structpin__driver__t.html">pin_driver_t</a> * me,<a class="code hl_enumeration" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type)</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>{</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>    GPIO_PinState PinState;</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>    <span class="keywordflow">if</span>(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_OD || me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">mode</a> == GPIO_MODE_OUTPUT_PP)</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>    {</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>        PinState = me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a>;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>        <span class="keywordflow">if</span>(PinState == GPIO_PIN_RESET)</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>            PinState = GPIO_PIN_SET;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>            PinState = GPIO_PIN_RESET;</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>        me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a> = PinState;</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>        HAL_GPIO_WritePin(me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">port</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin</a>,me-&gt;<a class="code hl_variable" href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_attr</a>[pin_type].<a class="code hl_variable" href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">state</a>);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>    }</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>}</div>
</div>
<div class="ttc" id="aled__driver_8c_html_a03a4e480218ba93667c8be3b533976da"><div class="ttname"><a href="led__driver_8c.html#a03a4e480218ba93667c8be3b533976da">gpio_clock_ebale</a></div><div class="ttdeci">static void gpio_clock_ebale(const char *name)</div><div class="ttdoc">gpio clk enable</div><div class="ttdef"><b>Definition</b> <a href="#l00091">led_driver.c:91</a></div></div>
<div class="ttc" id="aled__driver_8c_html_a16f0e758f9505cf4241ac3531058ba90"><div class="ttname"><a href="led__driver_8c.html#a16f0e758f9505cf4241ac3531058ba90">get_port_from_name</a></div><div class="ttdeci">static GPIO_TypeDef * get_port_from_name(const char *name)</div><div class="ttdoc">get port from name</div><div class="ttdef"><b>Definition</b> <a href="#l00030">led_driver.c:30</a></div></div>
<div class="ttc" id="aled__driver_8c_html_a1d910d69e5a02ecdd66993b6c939d9ed"><div class="ttname"><a href="led__driver_8c.html#a1d910d69e5a02ecdd66993b6c939d9ed">get_pull_from_name</a></div><div class="ttdeci">static uint32_t get_pull_from_name(const char *name)</div><div class="ttdoc">get pull from name</div><div class="ttdef"><b>Definition</b> <a href="#l00073">led_driver.c:73</a></div></div>
<div class="ttc" id="aled__driver_8c_html_a29f61f4f947d72aa4cec57fbccb4d2b4"><div class="ttname"><a href="led__driver_8c.html#a29f61f4f947d72aa4cec57fbccb4d2b4">pin_driver_register</a></div><div class="ttdeci">int pin_driver_register(pin_driver_t *me, pin_type_e pin_type, const char *pin_name)</div><div class="ttdoc">pin driver register</div><div class="ttdef"><b>Definition</b> <a href="#l00111">led_driver.c:111</a></div></div>
<div class="ttc" id="aled__driver_8c_html_a593c0d522193f5d68afec676e7bbfa0c"><div class="ttname"><a href="led__driver_8c.html#a593c0d522193f5d68afec676e7bbfa0c">get_mode_from_name</a></div><div class="ttdeci">static uint32_t get_mode_from_name(const char *name)</div><div class="ttdoc">get mode from name</div><div class="ttdef"><b>Definition</b> <a href="#l00055">led_driver.c:55</a></div></div>
<div class="ttc" id="aled__driver_8c_html_a5bb0271d4ae5eb2f4ad5abd83f0387c7"><div class="ttname"><a href="led__driver_8c.html#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a></div><div class="ttdeci">static int _init(pin_driver_t *me, pin_type_e pin_type)</div><div class="ttdoc">pin init</div><div class="ttdef"><b>Definition</b> <a href="#l00137">led_driver.c:137</a></div></div>
<div class="ttc" id="aled__driver_8c_html_aa935fef6ae8a8d5346c5ffe4033525aa"><div class="ttname"><a href="led__driver_8c.html#aa935fef6ae8a8d5346c5ffe4033525aa">pin_driver_ops</a></div><div class="ttdeci">static pin_driver_ops_t pin_driver_ops</div><div class="ttdef"><b>Definition</b> <a href="#l00017">led_driver.c:17</a></div></div>
<div class="ttc" id="aled__driver_8c_html_ac1fe82f7ae56795c7e934eb5fe8bc238"><div class="ttname"><a href="led__driver_8c.html#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a></div><div class="ttdeci">static int _get_state(pin_driver_t *me, pin_type_e pin_type, GPIO_PinState *state)</div><div class="ttdoc">pin get state</div><div class="ttdef"><b>Definition</b> <a href="#l00190">led_driver.c:190</a></div></div>
<div class="ttc" id="aled__driver_8c_html_acf867e62801ae7394802e18b3b428913"><div class="ttname"><a href="led__driver_8c.html#acf867e62801ae7394802e18b3b428913">get_pin_from_name</a></div><div class="ttdeci">static uint16_t get_pin_from_name(const char *name)</div><div class="ttdoc">get pin from name</div><div class="ttdef"><b>Definition</b> <a href="#l00042">led_driver.c:42</a></div></div>
<div class="ttc" id="aled__driver_8c_html_ad22a944898a0a1d9d4320579b5a096d8"><div class="ttname"><a href="led__driver_8c.html#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a></div><div class="ttdeci">static int _set_state(pin_driver_t *me, pin_type_e pin_type, GPIO_PinState state)</div><div class="ttdoc">pin set state</div><div class="ttdef"><b>Definition</b> <a href="#l00166">led_driver.c:166</a></div></div>
<div class="ttc" id="aled__driver_8c_html_aee9852ab0453d24837b6eb3cdb74172c"><div class="ttname"><a href="led__driver_8c.html#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a></div><div class="ttdeci">static int _toggle(pin_driver_t *me, pin_type_e pin_type)</div><div class="ttdoc">pin get toggle</div><div class="ttdef"><b>Definition</b> <a href="#l00209">led_driver.c:209</a></div></div>
<div class="ttc" id="aled__driver_8h_html"><div class="ttname"><a href="led__driver_8h.html">led_driver.h</a></div><div class="ttdoc">led driver harder file</div></div>
<div class="ttc" id="aled__driver_8h_html_a099fe16b9c572777e3811a5513ebaa34"><div class="ttname"><a href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></div><div class="ttdeci">pin_type_e</div><div class="ttdoc">struct of pin attribute</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00024">led_driver.h:25</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a4144813adfa4dfe7e7cbeea17d1b06eb"><div class="ttname"><a href="structpin__attr__t.html#a4144813adfa4dfe7e7cbeea17d1b06eb">pin_attr_t::pin</a></div><div class="ttdeci">uint16_t pin</div><div class="ttdoc">pin num,it can be ignored to save space</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00038">led_driver.h:38</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a49f666045d24aa8becc5244bc2396aca"><div class="ttname"><a href="structpin__attr__t.html#a49f666045d24aa8becc5244bc2396aca">pin_attr_t::init</a></div><div class="ttdeci">uint8_t init</div><div class="ttdoc">pin init</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00042">led_driver.h:42</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a5ac083a645d964373f022d03df4849c8"><div class="ttname"><a href="structpin__attr__t.html#a5ac083a645d964373f022d03df4849c8">pin_attr_t::name</a></div><div class="ttdeci">char * name</div><div class="ttdoc">pin name</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00036">led_driver.h:36</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a6b29e4f37f4482274af785ad5ffe96a7"><div class="ttname"><a href="structpin__attr__t.html#a6b29e4f37f4482274af785ad5ffe96a7">pin_attr_t::mode</a></div><div class="ttdeci">uint32_t mode</div><div class="ttdoc">pin mode,for add _set_mode and _get_mode functions the next version</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00040">led_driver.h:40</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a82241972e0292c7de95ea1e293e11be3"><div class="ttname"><a href="structpin__attr__t.html#a82241972e0292c7de95ea1e293e11be3">pin_attr_t::port</a></div><div class="ttdeci">GPIO_TypeDef * port</div><div class="ttdoc">pin port,it can be ignored to save space</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00037">led_driver.h:37</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_a90e9d12cadb88f452ec1dea603779bfb"><div class="ttname"><a href="structpin__attr__t.html#a90e9d12cadb88f452ec1dea603779bfb">pin_attr_t::state</a></div><div class="ttdeci">GPIO_PinState state</div><div class="ttdoc">pin state</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00039">led_driver.h:39</a></div></div>
<div class="ttc" id="astructpin__attr__t_html_af881021b980ca1b2632d0b302a58eba7"><div class="ttname"><a href="structpin__attr__t.html#af881021b980ca1b2632d0b302a58eba7">pin_attr_t::pull</a></div><div class="ttdeci">uint32_t pull</div><div class="ttdoc">pin pull,for add _set_pull and _get_pull functions the next version</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00041">led_driver.h:41</a></div></div>
<div class="ttc" id="astructpin__driver__ops_html"><div class="ttname"><a href="structpin__driver__ops.html">pin_driver_ops</a></div><div class="ttdoc">struct of pin driver oprations</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00060">led_driver.h:61</a></div></div>
<div class="ttc" id="astructpin__driver__ops_html_a021f2151c91ddf2521286bf6e58250db"><div class="ttname"><a href="structpin__driver__ops.html#a021f2151c91ddf2521286bf6e58250db">pin_driver_ops::pf_init</a></div><div class="ttdeci">int(* pf_init)(pin_driver_t *me, pin_type_e pin_type)</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00062">led_driver.h:62</a></div></div>
<div class="ttc" id="astructpin__driver__ops_html_a1d30bddbe51efba10017364033c8c0f2"><div class="ttname"><a href="structpin__driver__ops.html#a1d30bddbe51efba10017364033c8c0f2">pin_driver_ops::pf_set_state</a></div><div class="ttdeci">int(* pf_set_state)(pin_driver_t *me, pin_type_e pin_type, GPIO_PinState state)</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00065">led_driver.h:65</a></div></div>
<div class="ttc" id="astructpin__driver__t_html"><div class="ttname"><a href="structpin__driver__t.html">pin_driver_t</a></div><div class="ttdoc">struct of pin driver</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00049">led_driver.h:50</a></div></div>
<div class="ttc" id="astructpin__driver__t_html_a24f9910d53df9c5211690b1800116874"><div class="ttname"><a href="structpin__driver__t.html#a24f9910d53df9c5211690b1800116874">pin_driver_t::ops</a></div><div class="ttdeci">struct pin_driver_ops * ops</div><div class="ttdoc">pin driver opration awalys is that</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00052">led_driver.h:52</a></div></div>
<div class="ttc" id="astructpin__driver__t_html_aa1cb4d3f601a458d63d8236d5cd6cc82"><div class="ttname"><a href="structpin__driver__t.html#aa1cb4d3f601a458d63d8236d5cd6cc82">pin_driver_t::pin_attr</a></div><div class="ttdeci">pin_attr_t pin_attr[PIN_TYPE_MAX]</div><div class="ttdoc">pin attribute for all pin</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8h_source.html#l00051">led_driver.h:51</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
